package org.xx.Iterator;

public class StudentIterator implements Iterator{

    private StudentClass studentClass;

    private int index = 0;

    public StudentIterator(StudentClass studentClass) {
        this.studentClass = studentClass;
    }

    @Override
    public boolean hasNext() {
        return this.studentClass.getLength() > this.index;
    }

    @Override
    public Object next() {
        return this.studentClass.get(this.index++);
    }
}
